package com.java0106;

public class Java03 {
    public static void main(String[] args) {
        //字符串类
        String s1 = "abcde";//['a'，’b‘,'c','d','e']
        System.out.println(s1);

        boolean a = "abc".equals("abc");
        System.out.println(a);

        //查找
        int cd = "abcde".indexOf("cd");//返回起始下表，找不到返回-1;

        //截取
        String substring = "abcde".substring(1, 3);
        System.out.println(substring);

        //长度
        int d = "abcde".length();
        System.out.println(d);
        //去除两边空格
        String trim = "  jjj  ".trim();
        System.out.println(trim);
        //替换
        String sa = "abc123abc123".replace("123", "张三");
        System.out.println(sa);
        //根据下表获取字符
        char g = "abcde".charAt(0);
        System.out.println(g);

    }
}
